package com.runvp.common.util.enc;

public class StringToAsciiArray {
    public static void main(String[] args) {
        toScaii("BMrcujdO0XDjvOOa");
        toScaii("98BPRR4Wve41");
    }
    public static void ts(String input) {
        for (int i = 0; i < input.length(); i++) {
            int asciiCode = (int) input.charAt(i);
            System.out.println("Character: " + input.charAt(i) + " ASCII: " + asciiCode);
        }
    }
    public static byte[] toScaii(String input){
        byte[] asciiCodes = new byte[input.length()];
        for (int i = 0; i < input.length(); i++) {
            asciiCodes[i] = (byte) input.charAt(i);
        }
        // 输出ASCII数组
        for (int code : asciiCodes) {
            System.out.println(code);
        }
        return asciiCodes;
    }
}